import {defineConfig} from 'vite'
import vue from '@vitejs/plugin-vue'

// https://vite.dev/config/
export default defineConfig({
    plugins: [vue()],
    server: {
        host: "0.0.0.0",
        port: 3000,
        open: true,
        proxy: {
            // 代理 /dev-api 的请求
            '/dev-api': {
                changeOrigin: true,
                // 代理目标地址：https://api.youlai.tech
                target: 'http://127.0.0.1:8080',
                rewrite: (path) => path.replace(new RegExp("^" + '/dev-api'), ""),
            },
        },
    },
})
